package com.ygqh.baby.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.ygqh.baby.ao.Message;
import com.ygqh.baby.ao.PayType;
import com.ygqh.baby.ao.PriceType;
import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.po.YgAccountDetail;

public interface YgAccountDetailService {

	List<YgAccountDetail> find();

	int findCount();

	YgAccountDetail findById(Long id);

	int deleteSoft(Long[] ids);

	int deleteSoft(Long id);

	int save(YgAccountDetail ygAccountDetail);

	int update(YgAccountDetail ygAccountDetail);

	int saveOrUpdate(YgAccountDetail ygAccountDetail);

	ResultSet<YgAccountDetail> search(QueryInfo queryInfo, String q);

	Message addForPaySuccess(Long userId, Long paymentCode, BigDecimal totalPrice, PayType payType, String remark);

	int add(Long orderId, Long userId, PriceType priceType, BigDecimal accountPrice, String operation);

	/**
	 * 查找充值记录
	 * 
	 * @param queryInfo
	 * @param username
	 * @param source
	 *            来源，如果参数是 houtai则显示后台充值记录，否则显示全部
	 * @param startDate
	 * @param endDate
	 * @param remark
	 * @return
	 */
	ResultSet<YgAccountDetail> searchDetailByUser(QueryInfo queryInfo, String username, String source, Date startDate, Date endDate, String remark);

	YgAccountDetail findByOrderId(Long orderId, PriceType payorder);

	/**
	 * 充值成功处理业务逻辑
	 * 
	 * @param paymentCode
	 * @param userId
	 * @param totalPrice
	 * @param payType
	 * @param remark
	 * @return
	 */
	Message doBussnessForPaySuccess(Long paymentCode, Long userId, BigDecimal totalPrice, PayType payType, String remark);

	int addBatch(List<YgAccountDetail> accountDetail);
}
